<?php
/**
 * Convenience class to include batches of tests at a time
 * 
 * @author Alexander Schearer <aas11@duke.edu>
 */
class Tests_Manager extends GroupTest {
	
	/**
	 * Include all of the tests in the given directory
	 *
	 * <p>This will include any file with the word test in it
	 * as a test to be run by the group.  Note that it will
	 * not move recursively down through sub directories.
	 * 
	 * @param String $path path to directory
	 */
	public function addTestDirectory($path) {
		if (!is_dir($path))
			return;
		$dir = dir($path);
		while ($file = $dir->read()) {
			if (strstr($file, "test"))
				$this->addTestFile($dir->path . DIRECTORY_SEPARATOR . $file);
		}
	}
}
?>